package cn.z2huo.demo.mapstruct.dao.user.role;

import cn.hutool.core.util.RandomUtil;
import cn.z2huo.demo.mapstruct.dataobject.UserRoleRelationDO;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *
 * @author z2huo
 */
@Repository
public class UserRoleRelationDAO {

    public List<UserRoleRelationDO> getUserRoleList(String userCode) {

        int count = RandomUtil.randomInt(1, 11);
        List<UserRoleRelationDO> resultList = new ArrayList<>(count);
        for (int i = 0; i < count; i++) {
            resultList.add(new UserRoleRelationDO().setUserCode(userCode).setId(RandomUtil.randomLong())
                    .setRoleId(RandomUtil.randomLong()).setCreateTime(LocalDateTime.now()));
        }
        return resultList;
    }

}
